<template>
	<view class="page">
		<!-- 条件筛选 -->
		<FilterBar v-model="tabValue" @change="tabChange"></FilterBar>
		<!-- 列表 -->
		<NeedList v-if="listLoaded[0]" v-show="tabValue == '0'"></NeedList>
		<AskList v-if="listLoaded[1]" v-show="tabValue == '1'"></AskList>

		<!-- 底部标签栏 -->
		<c-business-tabbar class="tabbar" :index="3"></c-business-tabbar>
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import FilterBar from './components/filter-bar.vue';
	import NeedList from './components/need-list.vue';
	import AskList from './components/ask-list.vue';

	uni.hideHomeButton();
	
	const tabValue = ref('0');
	const listLoaded = ref({
		'0': true,
		'1': false,
	});
	
	const tabChange = (value) => {
		listLoaded.value[value] = true;
	}
</script>

<style>

</style>